// Component.h

/*
   Copyright 2006 Corey Tabaka

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

#include <Color.h>
#include <Dimension.h>
#include <Rectangle.h>
#include <Common.h>

#ifndef __GUI_COMPONENT_H__
#define __GUI_COMPONENT_H__

namespace gui {
	class Component {
		protected:
		
		RefComponent self;
		
		Rectangle rect;
		bool valid, visible, enabled;
		
		RefContainer parent;
		
		Color forground;
		Color background;
		
		//Font *font;
		
		public:
		
		Component(void);
		Component(RefContainer c);
		virtual ~Component(void);
		
		RefComponent getRef(void);
		
		virtual void setForground(Color c);
		virtual void setBackground(Color c);
		
		virtual Color getForground(void);
		virtual Color getBackground(void);
		
		virtual int getWidth(void);
		virtual int getHeight(void);
		
		virtual void validate(void);
		virtual void invalidate(void);
		virtual void repaint(RefGraphics g);
		virtual void paint(RefGraphics g);
		
		virtual void setLocation(int x, int y);
		virtual void setSize(int width, int height);
		virtual void setBounds(int x, int y, int width, int height);
		
		virtual Dimension getPreferredSize(void);
		virtual Dimension getMinimumSize(void);
		
		virtual void getBounds(Rectangle &r);
		
		virtual void setVisible(bool visible);
		virtual bool isVisible(void);
		virtual bool isRecursivelyVisible(void);
		
		virtual RefContainer getParent(void);
		virtual void setParent(RefContainer c);
	};
	
} // namespace gui

#endif
